package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 主题表实体类
 */
public class TopicBean {
    /**id*/
    private int id;
    /**主题名*/
    private String name;
    /**日期*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime date =LocalDateTime.now();
    /**内容*/
    private String info;
    /**作家*/
    private String author;
    private int num;
    private ChannelBean channel;
    private UserBean user;
    private List<RepliesBean> rList;

    public TopicBean() {
    }

    public TopicBean(String name, String info, String author,int num ,int channelId,int userId) {
        this.name = name;
        this.info = info;
        this.author = author;
        this.num=num;
        this.channel=new ChannelBean();
        this.channel.setId(channelId);
        this.user=new UserBean();
        this.user.setId(userId);
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public LocalDateTime getDate() {
        return date;
    }

    public void setDate(LocalDateTime date) {
        this.date = date;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDateTime getTime() {
        return date;
    }

    public void setTime(LocalDateTime time) {
        this.date = time;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public UserBean getUser() {
        return user;
    }

    public List<RepliesBean> getrList() {
        return rList;
    }

    public void setrList(List<RepliesBean> rList) {
        this.rList = rList;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "TopicBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", date=" + date +
                ", info='" + info + '\'' +
                ", author='" + author + '\'' +
                ", num=" + num +
                ", channel=" + channel +
                ", user=" + user +
                ", rList=" + rList +
                "}\n";
    }
}
